package com.sskj.hhrt.market.bean;

import com.github.tifezh.kchartlib.chart.entity.IKLine;
import com.github.tifezh.kchartlib.chart.entity.IMinuteLine;
import com.github.tifezh.kchartlib.chart.entity.IWR;

import java.util.Date;

/**
 * Created by Administrator on 2018/4/3.
 */

public class Stock implements IKLine, IMinuteLine, IWR {


    /**
     * id : 13174
     * period : null
     * code : CFDCL
     * volume : null
     * openPrice : 59.26
     * closePrice : 59.26
     * high : 59.27
     * low : 59.26
     * date : 2019-03-26
     * time : 13:22:00
     * createTime : null
     * status : 0
     * timestamp : 1553577741000
     */

    private int id;
    private String period;
    private String code;
    private Float volume;
    private Float openPrice;
    private Float closePrice;
    private Float high;
    private Float low;
    private String date;
    private String time;
    private String createTime;
    private int status;
    private long timestamp;


    public float MA5Price;

    public float MA10Price;

    public float MA20Price;

    public float dea;

    public float dif;

    public float macd;

    public float k;

    public float d;

    public float j;

    public float rsi1;

    public float rsi2;

    public float rsi3;

    public float up;

    public float mb;

    public float dn;

    public float MA5Volume;

    public float MA10Volume;

    public float wr;


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getPeriod() {
        return period;
    }

    public void setPeriod(String period) {
        this.period = period;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setVolume(Float volume) {
        if (volume == null) {
            volume = 0f;
        }
        this.volume = volume;
    }

    public void setOpenPrice(Float openPrice) {
        if (openPrice == null) {
            openPrice = 0f;
        }
        this.openPrice = openPrice;
    }

    public void setClosePrice(Float closePrice) {
        if (closePrice == null) {
            closePrice = 0f;
        }

        this.closePrice = closePrice;
    }

    public Float getHigh() {
        return high;
    }

    public void setHigh(Float high) {
        if (high == null) {
            high = 0f;
        }
        this.high = high;
    }

    public Float getLow() {
        return low;
    }

    public void setLow(Float low) {
        if (low == null) {
            low = 0f;
        }
        this.low = low;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    @Override
    public float getOpenPrice() {
        return openPrice;
    }

    @Override
    public float getHighPrice() {
        return high==null?0:high;
    }

    @Override
    public float getLowPrice() {
        return low==null?0:low;
    }

    @Override
    public float getClosePrice() {
        return closePrice;
    }

    @Override
    public float getVolume() {
        return volume == null ? 0 : volume;
    }

    @Override
    public float getMA5Volume() {
        return MA5Volume;
    }

    @Override
    public void setMA5Volume(float v) {
        this.MA5Volume = v;
    }

    @Override
    public float getMA10Volume() {
        return MA10Volume;
    }

    @Override
    public void setMA10Volume(float v) {
        this.MA10Volume = v;
    }

    @Override
    public void setClosePrice(float v) {

        this.closePrice = v;
    }

    @Override
    public float getMA5Price() {
        return MA5Price;
    }

    @Override
    public void setMA5Price(float v) {
        this.MA5Price = v;
    }

    @Override
    public float getMA10Price() {
        return MA10Price;
    }

    @Override
    public void setMA10Price(float v) {
        this.MA10Price = v;
    }

    @Override
    public float getMA20Price() {
        return MA20Price;
    }

    @Override
    public void setMA20Price(float v) {
        this.MA20Price = v;
    }

    @Override
    public long getDatetime() {
        return timestamp;
    }

    @Override
    public float getUp() {
        return up;
    }

    @Override
    public void setUp(float v) {
        this.up = v;
    }

    @Override
    public float getMb() {
        return mb;
    }

    @Override
    public void setMb(float v) {
        this.mb = v;
    }

    @Override
    public float getDn() {
        return dn;
    }

    @Override
    public void setDn(float v) {
        this.dn = v;
    }

    @Override
    public float getK() {
        return k;
    }

    @Override
    public void setK(float v) {
        this.k = v;
    }

    @Override
    public float getD() {
        return d;
    }

    @Override
    public void setD(float v) {
        this.d = v;
    }

    @Override
    public float getJ() {
        return j;
    }

    @Override
    public void setJ(float v) {
        this.j = v;
    }

    @Override
    public float getDea() {
        return dea;
    }

    @Override
    public void setDea(float v) {
        this.dea = v;
    }

    @Override
    public float getDif() {
        return dif;
    }

    @Override
    public void setDif(float v) {
        this.dif = v;
    }

    @Override
    public float getMacd() {
        return macd;
    }

    @Override
    public void setMacd(float v) {
        this.macd = v;
    }

    @Override
    public float getAvgPrice() {
        return low;
    }

    @Override
    public float getPrice() {
        return closePrice;
    }

    @Override
    public Date getMinuteDate() {
        return new Date(timestamp);
    }

    @Override
    public float getRsi1() {
        return rsi1;
    }

    @Override
    public float getRsi2() {
        return rsi2;
    }

    @Override
    public float getRsi3() {
        return rsi3;
    }

    @Override
    public void setRsi1(float v) {
        this.rsi1 = v;
    }

    @Override
    public void setRsi2(float v) {
        this.rsi2 = v;
    }

    @Override
    public void setRsi3(float v) {
        this.rsi3 = v;
    }

    @Override
    public float getWr() {
        return wr;
    }

    @Override
    public void setWr(float v) {
        this.wr = v;
    }
}
